mock.c: fix checking of HAVE_GLIBC_IOCTL#985
Merged
igaw merged 1 commit intolinux-nvme:masterfrom Apr 7, 2025
Merged
Conversation
Commit [ 0d8d0a5 build: do not include config.h globally ] changed to always pass -DHAVE_GLIBC_IOCTL=[0|1], and this causes a regression, for system without glibc ioctl, -DHAVE_GLIBC_IOCTL=0 is passed, and causes error: ../git/test/ioctl/mock.c:123:5: error: conflicting types for 'ioctl'; have 'int(int, long unsigned int, ...)' 123 | int ioctl(int fd, unsigned long request, ...) | ^~~~~ In file included from ../git/test/ioctl/mock.c:9: pathto/usr/include/sys/ioctl.h:115:5: note: previous declaration of 'ioctl' with type 'int(int, int, ...)' 115 | int ioctl (int, int, ...); Fixed by checking value of HAVE_GLIBC_IOCTL in mock.c Signed-off-by: Changqing Li <[email protected]>
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit [ 0d8d0a5 build: do not include config.h globally ] changed to always pass -DHAVE_GLIBC_IOCTL=[0|1], and this causes a regression, for system without glibc ioctl, -DHAVE_GLIBC_IOCTL=0 is passed, and causes error:
../git/test/ioctl/mock.c:123:5: error: conflicting types for 'ioctl'; have 'int(int, long unsigned int, ...)'
123 | int ioctl(int fd, unsigned long request, ...)
| ^~~~~
In file included from ../git/test/ioctl/mock.c:9:
pathto/usr/include/sys/ioctl.h:115:5: note: previous declaration of 'ioctl' with type 'int(int, int, ...)'
115 | int ioctl (int, int, ...);
Fixed by checking value of HAVE_GLIBC_IOCTL in mock.c